<style scoped="scoped">
.fourAdvertising{
	background-size:cover ; height: 8rem;
}
</style>

<template>
  <grid :cols='2'>
    <grid-item  
    	v-for="(value,index) in fourAdvertising" 
    	link="/activePage"  
    	:key="index" 
    	class='fourAdvertising' 
    	:style="{backgroundImage: buildBackground(value)}">
    </grid-item>
  </grid>
</template>

<script>
import { Grid, GridItem } from 'vux'
import Data from '@/server/server.js'
export default {
  components: { Grid, GridItem },
  data () {
    return {
      fourAdvertising: []
    }
  },
  methods : {
  	 buildBackground (item) {
      return `url(${item.image})`
    }
  },
  mounted (){
  	Data.fourAdvertising.then(data => {
  		this.fourAdvertising=data;
  		this.$parent.$refs.bottomGoods.bindSticky ()
  	})
  }
}
</script>

